Skip to content

Fix brightness/CCT/color not responding on FS230 and FS150C - #118

Open
ASD5806 wants to merge 3 commits into
keefo:mainfrom
ASD5806:fix/fs150c-fs230-brightness-cct-color
Open

ASD5806 wants to merge 3 commits into
keefo:mainfrom
ASD5806:fix/fs150c-fs230-brightness-cct-color

Conversation

@ASD5806

@ASD5806 ASD5806 commented Sep 19, 2026

Copy link
Copy Markdown

Both lights' crowd-sourced database entries are missing commandPatterns, so the app fell back to the legacy setLongCCTLightBrightness/ setLongCCTLightCCT (0x82/0x83) command family. That family is acknowledged by the firmware (notify replies look normal) but does not actually drive the LED output on these two models, so the brightness and CCT sliders had no physical effect while power control worked fine.

Root cause for the FS150C specifically: its raw model number "20230029" had no entry in getProjectName(_ str:), so its nickname never resolved to "FS150C", which meant getLightType() could never reach its dedicated branch and instead silently fell back to a generic default (lightType 0), which in turn made CCTRange() fall back to the generic 3200-5600K range instead of the FS150C's real 2500-7500K.

Changes:

  • getProjectName(_ str:): map "20230029" to "FS150C" so the light is correctly identified (NeewerLightConstant.swift).
  • CCTRange(ligthType:projectName:): add the FS150C's real 2500-7500K range instead of falling back to the generic 3200-5600K default (NeewerLightConstant.swift).
  • builtInCommandPatterns(lightType:): new fallback consulted by findCommandPatternFromDB() after the live database and temporaryCommandPatterns, so it survives a database.json re-sync. Provides power/cct patterns for FS230 (type 53) and FS150C (type 75), and an hsi (color) pattern for the FS150C, which is a true RGB light per its product listing (the FS230's database entry explicitly marks it as non-RGB). The cct/power patterns were physically confirmed against real hardware; the hsi pattern is copied verbatim from every other RGB-capable light in the same tag family sharing this exact cct pattern shape (identical hsi pattern across all of them, so it should generalize), and was also confirmed working on the FS150C.
  • getCCTOnlyLightCommand(): send the brightness and CCT legacy commands as two separate BLE writes with a short delay between them instead of one concatenated packet, since write() debounces/cancels a pending write within 15ms of the next one. This didn't turn out to fix the FS230/FS150C issue on its own (root cause was the missing command patterns above), but it's a real, independent correctness fix for any other light that still relies on this legacy code path.

Tested on real hardware: 2x FS150C, 1x FS230 5600K.

Both lights' crowd-sourced database entries are missing commandPatterns,
so the app fell back to the legacy setLongCCTLightBrightness/
setLongCCTLightCCT (0x82/0x83) command family. That family is
acknowledged by the firmware (notify replies look normal) but does not
actually drive the LED output on these two models, so the brightness
and CCT sliders had no physical effect while power control worked fine.

Root cause for the FS150C specifically: its raw model number
"20230029" had no entry in getProjectName(_ str:), so its nickname
never resolved to "FS150C", which meant getLightType() could never
reach its dedicated branch and instead silently fell back to a generic
default (lightType 0), which in turn made CCTRange() fall back to the
generic 3200-5600K range instead of the FS150C's real 2500-7500K.

Changes:
- getProjectName(_ str:): map "20230029" to "FS150C" so the light is
  correctly identified (NeewerLightConstant.swift).
- CCTRange(ligthType:projectName:): add the FS150C's real 2500-7500K
  range instead of falling back to the generic 3200-5600K default
  (NeewerLightConstant.swift).
- builtInCommandPatterns(lightType:): new fallback consulted by
  findCommandPatternFromDB() after the live database and
  temporaryCommandPatterns, so it survives a database.json re-sync.
  Provides power/cct patterns for FS230 (type 53) and FS150C (type 75),
  and an hsi (color) pattern for the FS150C, which is a true RGB light
  per its product listing (the FS230's database entry explicitly marks
  it as non-RGB). The cct/power patterns were physically confirmed
  against real hardware; the hsi pattern is copied verbatim from every
  other RGB-capable light in the same tag family sharing this exact cct
  pattern shape (identical hsi pattern across all of them, so it should
  generalize), and was also confirmed working on the FS150C.
- getCCTOnlyLightCommand(): send the brightness and CCT legacy commands
  as two separate BLE writes with a short delay between them instead of
  one concatenated packet, since write() debounces/cancels a pending
  write within 15ms of the next one. This didn't turn out to fix the
  FS230/FS150C issue on its own (root cause was the missing command
  patterns above), but it's a real, independent correctness fix for any
  other light that still relies on this legacy code path.

Tested on real hardware: 2x FS150C, 1x FS230 5600K.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@keefo

keefo commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Thanks a lot for this PR, and for testing on real FS150C and FS230 hardware! The diagnosis is spot on: both lights were falling back to the legacy 0x82/0x83 commands. There are a few things I'd like changed before merging:

1. Please move the command patterns into Database/lights.json instead of builtInCommandPatterns().
The app downloads lights.json from GitHub at runtime, which lets light fixes ship without a new app release. That's how #108, #109 and #112 added support. Could you:

  • add commandPatterns (power, cct) to the existing type 53 (FS230 5600K) entry
  • add a new type 75 (FS150C) entry with power / cct / hsi patterns and cctRange 25–75. The CB120B entry (type 70) is a good template.

Then builtInCommandPatterns and the type-75 special case in CCTRange(ligthType:projectName:) can be dropped, because NeewerLight.CCTRange() already reads the range from the pattern or the DB cctRange.

2. Please drop the getCCTOnlyLightCommand change.
As you noted, it didn't fix these lights, and it changes behaviour for every light that still uses the legacy path. The CCT write is sent 50ms later, and write() cancels any pending write, so while a slider is being dragged that late write can cancel a newer command. The light can then end up on an older CCT value. It also makes a get…Command function write to the light itself and return empty Data, which is confusing.

3. Could you double-check brightness-only changes on the FS230?
setBRR100LightValues never looks at the command patterns. In CCT mode on a non-RGB light it still calls the legacy getCCTOnlyLightCommand. It's called from the brightness path in CollectionViewItem.swift and from Server.swift (Stream Deck / MCP brightness). If brightness-only changes don't move the light, that path needs to use the cct pattern (with the current CCT) too.

The "20230029" → "FS150C" mapping in getProjectName looks good. Please keep it.

Thanks again!

@kmnstudios

Copy link
Copy Markdown

Following up with a suggestion prompted by your review comments on #118.

You noted there that command-pattern fixes should live in Database/lights.json so they ship without an app release — and for this issue, that may be the entire fix: removing the cct pattern from the type-4 (GL1) entry. With no pattern defined, findCommandPatternFromDB("cct") returns nil and the light falls through to getCCTOnlyLightCommand(), which composes exactly the separate 0x78 0x82 / 0x78 0x83 frames this firmware accepts (verified working on my unit — a single 0x82 frame injected via the pattern editor drives brightness perfectly, where every 0x87-based pattern is ignored).

#118 is the mirror image of this issue: those lights fell back to the legacy frames and needed combined patterns; mine is stuck on a combined pattern and needs the legacy fallback. Deleting that one DB entry would reach my light on the next database auto-sync — no release needed.

The second request (persisting user-edited temporaryCommandPatterns across restarts) would still need an app-side change, but it becomes a nice-to-have once the DB entry is fixed.

Happy to test either — this unit reproduces the problem in about ten seconds.

(Diagnosis and this comment drafted by Claude, who did the protocol archaeology; I just move the sliders.)

Alan Dick and others added 2 commits November 3, 2026 16:12
setBRR100LightValues() skipped findCommandPatternFromDB("cct") in CCT mode
and always built the legacy packet, so brightness-only changes (Stream Deck
dial, MCP set_brightness) updated the UI but not lights whose working CCT
command is pattern-based. Route through setCCTLightValues() when a cct
pattern exists, matching the HSI branch.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BTXihLs9VFMXcUAJtDJ2se
- Add power/cct commandPatterns to the type 53 (FS230) entry and a new
  type 75 (FS150C) entry with power/cct/hsi and cctRange 25-75.
- Remove builtInCommandPatterns() and the type-75 CCTRange special case.
- Drop the getCCTOnlyLightCommand split-write change.
- Keep the "20230029" -> "FS150C" mapping and the setBRR100LightValues
  cct-pattern fix.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BTXihLs9VFMXcUAJtDJ2se
@ASD5806

ASD5806 commented Nov 3, 2026

Copy link
Copy Markdown
Author

Thanks for the review. I've pushed the changes:

  1. Patterns moved to Database/lights.json: power and cct added to type 53, and a new type 75 (FS150C) entry with power/cct/hsi and cctRange 25–75, modeled on CB120B. builtInCommandPatterns() and the type-75 CCTRange case are removed.
  2. The getCCTOnlyLightCommand change is dropped.
  3. You were right about setBRR100LightValues. In CCT mode it never checked for a cct pattern, so brightness-only changes (Stream Deck dial, MCP set_brightness) updated the UI but not the light. It now goes through setCCTLightValues when a cct pattern exists. Confirmed on hardware: the Stream Deck brightness dial now moves the light. This likely also explains Stream Deck dial will change NeewerLite app but not device #96.
  4. The 20230029 → FS150C mapping is unchanged.

Note: the lights.json entries use the same pattern strings I tested on 2× FS150C and 1× FS230 (power, brightness, CCT, and HSI on the FS150C) with an earlier in-code version, but I haven't been able to run the lights.json route itself on hardware before it is merged and synced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants